package com.example.chatapp.repository;

import com.example.chatapp.model.MessageEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface MessageRepository extends JpaRepository<MessageEntity, Long> {
    Page<MessageEntity> findByRoomIdOrderBySeqDesc(String roomId, Pageable pageable);
    List<MessageEntity> findByRoomIdAndSeqGreaterThanOrderBySeqAsc(String roomId, Long seq);
}
